import 'dart:io';

import 'package:dio/dio.dart';
import 'dart:convert';
import '';
import '../const.dart';
class MLHttpTool {
  static final MLHttpTool instance = MLHttpTool.shareInstance();
  Dio client;
  MLHttpTool.shareInstance() {
    if(client == null){
      
      Map<String,dynamic> headers = {
        "Content-Type": "application/json;charset=UTF-8",
        "responseType": ResponseType.json,
      };

      BaseOptions options = BaseOptions(
        headers: headers,
        baseUrl: MainUrl,
        connectTimeout: 5000,
        receiveTimeout: 3000,
        contentType:
            ContentType.parse('application/x-www-form-urlencoded').toString(),
      );
      client = Dio(options);
    }
  }
}
